package com.atguigu.gulimall.member.feign.fallback;

import com.atguigu.common.exception.BizCodeEnum;
import com.atguigu.common.utils.R;
import com.atguigu.gulimall.member.feign.OrderFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @create: 2024/9/15
 * @author: gyhe10
 * @description: 远程调用 order 服务的 feign 接口的降级实现类
 **/
@Slf4j
@Component
public class OrderFeignServiceFallback implements OrderFeignService {
    @Override
    public R getOrderListWithOrderItems(Map<String, Object> params) {
        log.error("远程调用 order 服务分页查询当前登录用户的订单列表失败");
        return R.error(BizCodeEnum.CALL_OTHER_SERVICE_EXCEPTION.getCode(), "远程调用 order 服务分页查询当前登录用户的订单列表失败");
    }
}
